package com.ysq.www.api.front.mapper;

import com.ysq.www.api.front.entity.InformationTag;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 资讯标签表 Mapper 接口
 * </p>
 *
 * @author dql
 * @since 2020-08-07
 */
public interface InformationTagMapper extends BaseMapper<InformationTag> {

    /**
     * 根据资讯id查询标签集合
     * @param id 资讯id
     * @return List
     */
    @Select("select * from t_information_tag where id in(select tag_id from t_information_tag_middle where information_id = #{id})")
    List<InformationTag> selectTagByITMId(Integer id);
}
